package com.example.demo14streamconsumer.service;

import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Service;

/**
 * @author Created by yawn on 2017-11-06 20:35
 */
@Service
public class ReceiveService {

    @StreamListener("myInputChannel")
//    @StreamListener(Sink.INPUT)
    public void onReceive(byte[] msg) {
        System.out.println("收到消息：" + new String(msg));
    }
}
